package com.tianqu.tms.www.car.action;

import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import com.tianqu.tms.core.base.Logger;
import com.tianqu.tms.core.base.TmsAjaxAction;
import com.tianqu.tms.core.base.UserContext;
import com.tianqu.tms.core.exception.TmsException;
import com.tianqu.tms.entity.Car;

/**
 *  mufeiyu
 */
public class CarInformationMatchInfoAjaxAction extends TmsAjaxAction{
	private Logger logger = Logger.getLogger(CarInformationMatchInfoAjaxAction.class);
	@Override
	public void process( ActionMapping mapping, ActionForm form
	                                          , HttpServletRequest request
	                                          , HttpServletResponse response
	                                          , UserContext uc)throws TmsException {
		
		logger.debug(this.getClass().getName() + "#execute.");
		
		String vin = request.getParameter("vin");
		Car car = Car.getInstance();
		List<Car> list = car.findCarInfoListByVin(vin);
		if(list.size() == 0)
		{
			responseValues(response, "0", TEXT);
		}else {
			responseValues(response, "1", TEXT);
		}

		logger.debug(this.getClass().getName() + "#doAction was completed.");
	}
}
